<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: nlao_exceptions.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">nlao_exceptions.h</div>  </div>
</div>
<div class="contents">
<a href="nlao__exceptions_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*This file is prepared for Doxygen automatic documentation generation.*/</span>
<a name="l00015"></a>00015 <span class="comment">/* Copyright (c) 2009 Atmel Corporation. All rights reserved.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
<a name="l00018"></a>00018 <span class="comment"> * modification, are permitted provided that the following conditions are met:</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * 1. Redistributions of source code must retain the above copyright notice, this</span>
<a name="l00021"></a>00021 <span class="comment"> * list of conditions and the following disclaimer.</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright notice,</span>
<a name="l00024"></a>00024 <span class="comment"> * this list of conditions and the following disclaimer in the documentation</span>
<a name="l00025"></a>00025 <span class="comment"> * and/or other materials provided with the distribution.</span>
<a name="l00026"></a>00026 <span class="comment"> *</span>
<a name="l00027"></a>00027 <span class="comment"> * 3. The name of Atmel may not be used to endorse or promote products derived</span>
<a name="l00028"></a>00028 <span class="comment"> * from this software without specific prior written permission.</span>
<a name="l00029"></a>00029 <span class="comment"> *</span>
<a name="l00030"></a>00030 <span class="comment"> * 4. This software may only be redistributed and used in connection with an Atmel</span>
<a name="l00031"></a>00031 <span class="comment"> * AVR product.</span>
<a name="l00032"></a>00032 <span class="comment"> *</span>
<a name="l00033"></a>00033 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY ATMEL &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED</span>
<a name="l00034"></a>00034 <span class="comment"> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span>
<a name="l00035"></a>00035 <span class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE</span>
<a name="l00036"></a>00036 <span class="comment"> * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR</span>
<a name="l00037"></a>00037 <span class="comment"> * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span>
<a name="l00038"></a>00038 <span class="comment"> * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span>
<a name="l00039"></a>00039 <span class="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span>
<a name="l00040"></a>00040 <span class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<a name="l00041"></a>00041 <span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00042"></a>00042 <span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE</span>
<a name="l00043"></a>00043 <span class="comment"> *</span>
<a name="l00044"></a>00044 <span class="comment"> */</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="preprocessor">#ifndef __AVR32_NEWLIB_ADDONS_EXCEPTIONS_H__</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define __AVR32_NEWLIB_ADDONS_EXCEPTIONS_H__</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;_ansi.h&gt;</span>
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 _BEGIN_STD_C
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="comment">/*</span>
<a name="l00054"></a>00054 <span class="comment"> Exception vector offsets</span>
<a name="l00055"></a>00055 <span class="comment">*/</span>
<a name="l00056"></a><a class="code" href="nlao__exceptions_8h.html#ac215c7cb6e5033b663260a42a44dab0a">00056</a> <span class="preprocessor">#define EVBA_UNRECOVERABLE    0x000</span>
<a name="l00057"></a><a class="code" href="nlao__exceptions_8h.html#a31461f5d717738999b55cdf4d428af2e">00057</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_TLB_MULTIPLE     0x004</span>
<a name="l00058"></a><a class="code" href="nlao__exceptions_8h.html#a55158ed208b164a61a42fa701b7eb03e">00058</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_BUS_ERROR_DATA   0x008</span>
<a name="l00059"></a><a class="code" href="nlao__exceptions_8h.html#a8770d5f1f176277d1a7c593118e1a470">00059</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_BUS_ERROR_INSTR  0x00C</span>
<a name="l00060"></a><a class="code" href="nlao__exceptions_8h.html#ac652bf2b08df2b52560bb438a14dbe98">00060</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_NMI              0x010</span>
<a name="l00061"></a><a class="code" href="nlao__exceptions_8h.html#a4453c57a4d7d461ce473ba3c5405a4ab">00061</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_INSTR_ADDR       0x014</span>
<a name="l00062"></a><a class="code" href="nlao__exceptions_8h.html#ac2eab2d14839ee6095ea05db56abf501">00062</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_ITLB_MISS        0x050</span>
<a name="l00063"></a><a class="code" href="nlao__exceptions_8h.html#a8e5c3c7b30919aea6833223514f58385">00063</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_ITLB_PROT        0x018</span>
<a name="l00064"></a><a class="code" href="nlao__exceptions_8h.html#a8dce9622fcddfacdbaa458004d620c8d">00064</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_BREAKPOINT       0x01C</span>
<a name="l00065"></a><a class="code" href="nlao__exceptions_8h.html#abeba647d50f94b9445d117ed20909163">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_ILLEGAL_OPCODE   0x020</span>
<a name="l00066"></a><a class="code" href="nlao__exceptions_8h.html#a6911672632347b84e20483202d92f113">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_UNIMPLEMENTED    0x024</span>
<a name="l00067"></a><a class="code" href="nlao__exceptions_8h.html#aa42affe464bff8531c7a7978837685d7">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_PRIVILEGE_VIOL   0x028</span>
<a name="l00068"></a><a class="code" href="nlao__exceptions_8h.html#a7c4ecabd1d8258a7dac3b43516c445d1">00068</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_FLOATING_POINT   0x02C</span>
<a name="l00069"></a><a class="code" href="nlao__exceptions_8h.html#a6f794069ca6ddde4eb73699f080e6bcd">00069</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_COP_ABSENT       0x030</span>
<a name="l00070"></a><a class="code" href="nlao__exceptions_8h.html#aa3a9daee109e36e31805806536f917f5">00070</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_SCALL            0x100</span>
<a name="l00071"></a><a class="code" href="nlao__exceptions_8h.html#aafa6b4da406695dca75dcddcb3ca7cd2">00071</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_DATA_ADDR_R      0x034</span>
<a name="l00072"></a><a class="code" href="nlao__exceptions_8h.html#a06ee97b01a1aa1025bfb61e61edb32e4">00072</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_DATA_ADDR_W      0x038</span>
<a name="l00073"></a><a class="code" href="nlao__exceptions_8h.html#a35322d182a9b72dd38f30305992d1175">00073</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_DTLB_MISS_R      0x060</span>
<a name="l00074"></a><a class="code" href="nlao__exceptions_8h.html#a79c079963607952fa53149b71bad9d7c">00074</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_DTLB_MISS_W      0x070</span>
<a name="l00075"></a><a class="code" href="nlao__exceptions_8h.html#ae3c4f25ea7b3eaa9e3bb148c4ee14823">00075</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_DTLB_PROT_R      0x03C</span>
<a name="l00076"></a><a class="code" href="nlao__exceptions_8h.html#a25f5156f526641538a93a5da608107d2">00076</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_DTLB_PROT_W      0x040</span>
<a name="l00077"></a><a class="code" href="nlao__exceptions_8h.html#a0ca9cf0e615977fd48ae3096b2518120">00077</a> <span class="preprocessor"></span><span class="preprocessor">#define EVBA_DTLB_MODIFIED    0x044</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span>
<a name="l00079"></a>00079 
<a name="l00080"></a>00080 <span class="comment">/*</span>
<a name="l00081"></a>00081 <span class="comment">   Define the form of the function used when registering exceptions.</span>
<a name="l00082"></a>00082 <span class="comment">   The function should return the address which the exception should</span>
<a name="l00083"></a>00083 <span class="comment">   return to after the exception processing.</span>
<a name="l00084"></a>00084 <span class="comment">*/</span>
<a name="l00085"></a>00085 
<a name="l00086"></a><a class="code" href="nlao__exceptions_8h.html#aa40550731e9ab5234a77eefb5a4a50f3">00086</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> int (*<a class="code" href="nlao__exceptions_8h.html#aa40550731e9ab5234a77eefb5a4a50f3">__exception_handler</a>)(<span class="keywordtype">int</span> <span class="comment">/*evba_offset*/</span>, <span class="keywordtype">int</span> <span class="comment">/*return address*/</span>);
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="comment">/*</span>
<a name="l00089"></a>00089 <span class="comment">   Define the form of the function used when registering a scall handler.</span>
<a name="l00090"></a>00090 <span class="comment">*/</span>
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="nlao__exceptions_8h.html#a0be8acafb9e70147733c0cb52c9a0b75">00092</a> <span class="keyword">typedef</span> void (*<a class="code" href="nlao__exceptions_8h.html#a0be8acafb9e70147733c0cb52c9a0b75">__scall_handler</a>)(<span class="keywordtype">int</span> <span class="comment">/*code*/</span>, <span class="keywordtype">int</span> <span class="comment">/*p1*/</span>, <span class="keywordtype">int</span> <span class="comment">/*p2*/</span>
<a name="l00093"></a>00093                                          , <span class="keywordtype">int</span> <span class="comment">/*p3*/</span>, <span class="keywordtype">int</span> <span class="comment">/*p4*/</span>);
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 <span class="comment">/*</span>
<a name="l00096"></a>00096 <span class="comment">   Function for registering an exception handler for the exception with</span>
<a name="l00097"></a>00097 <span class="comment">   offset given by evba_offset.</span>
<a name="l00098"></a>00098 <span class="comment">*/</span>
<a name="l00099"></a>00099 <span class="keywordtype">void</span> <a class="code" href="nlao__exceptions_8h.html#a013ccd5118bc2cdcf33063ecaf98a04a">_register_exception_handler</a>(<a class="code" href="nlao__exceptions_8h.html#aa40550731e9ab5234a77eefb5a4a50f3">__exception_handler</a> handler, <span class="keywordtype">int</span> evba_offset);
<a name="l00100"></a>00100 
<a name="l00101"></a>00101 <span class="comment">/*</span>
<a name="l00102"></a>00102 <span class="comment">   Function for registering a scall handler which can be a arbirary</span>
<a name="l00103"></a>00103 <span class="comment">   function which uses r8-r12 for parameters.</span>
<a name="l00104"></a>00104 <span class="comment">*/</span>
<a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="nlao__exceptions_8h.html#a54867d9e35bc8f296cb68271f0ba6475">_register_scall_handler</a>(<a class="code" href="nlao__exceptions_8h.html#a0be8acafb9e70147733c0cb52c9a0b75">__scall_handler</a> handler);
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 <span class="comment">/*</span>
<a name="l00108"></a>00108 <span class="comment">   Initialize exceptions. Must be called before registering exception handlers</span>
<a name="l00109"></a>00109 <span class="comment">   and needed to enable exceptions. &#39;evba&#39; is the pointer to the exception</span>
<a name="l00110"></a>00110 <span class="comment">   vector. &#39;handler_table&#39; is a pointer to an array where the pointers to</span>
<a name="l00111"></a>00111 <span class="comment">   the exception handlers are stored. This array must be at least 0x104 bytes</span>
<a name="l00112"></a>00112 <span class="comment">   and word aligned.</span>
<a name="l00113"></a>00113 <span class="comment">*/</span>
<a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="nlao__exceptions_8h.html#a5f699ca8a3756917719ca80605d53d39">init_exceptions</a>(<span class="keywordtype">void</span> *evba, <span class="keywordtype">void</span> *handler_table);
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 _END_STD_C
<a name="l00117"></a>00117 
<a name="l00118"></a>00118 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 29 2011 17:59:31 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
